{{extend "config_layout.html"}}

{{block menu}}
{{menu('config')}}
{{end}}

{{block sub_menu}}
{{sub_menu(menu_items, 'admin_config', 'users')}}
{{end}}

{{block content_main}}
{{use "jquery", css_only=True}}
<div class="content">
    <div class="col_12 center">
        <table border="0" width="100%">
            <tr>
            <td width="80" valign="top">
                {{if request.user and request.user.id==object.id:}}
                <a href="{{=url_for('config.views_users.config_users_edit_image')}}" title="{{=_('Click to change portrait')}}"><img src="{{=image_url}}" class="portrait"/></a>
                {{else:}}
                <img src="{{=image_url}}" class="portrait"/>
                {{pass}}
            </td>
            <td>
            <div class="box">
                <h2>用户信息查看</h2>
                <div class="box-body">
                    {{embed view}}
                    <div style="padding:5px;">
                    {{if request.user.is_superuser or (request.user.is_manager and request.user.members.has(object)):}}
                    <a href="/config/users/{{=object.id}}/edit">编辑</a>
                    {{elif object.id==request.user.id:}}
                    <a href="/config/user/edit">编辑</a>
                    {{pass}}
                    {{if request.user.is_superuser or (request.user.is_manager and request.user.members.has(object)):}}
                    <a href="/config/users/{{=object.id}}/delete" onclick="return confirm('确定要删除当前记录吗？');">删除</a>
                    {{pass}}
                    {{if request.user.is_superuser:}}
                    <a href="/config/users/{{=object.id}}/reset" onclick="return confirm('确定要重置当前用户密码吗？');">重置密码</a>
                    {{pass}}
                    </div>
                </div>
            </div>
            </td>
            </tr>
        </table>
    </div>
</div>
{{end}}
